# -*- coding: utf-8 -*-

import os
import tempfile
import datetime

def saveData( text, code='py' ):
	#tempdir = tempfile.mkdtemp(prefix='Mayapad')
	tempdir = tempfile.gettempdir()
	dt = datetime.datetime
	timestamp = dt.now().strftime("%Y%m%d%H%M%S") 
	path = tempdir + os.sep + 'Mayapad_' + timestamp + '.' + code
	#print path
	fp = open(path, 'w')
	fp.write(text)
	fp.close()
	return path
